/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
:root {
    /* Primary Palette */
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8F66;
    --secondary: #E84545;
    --accent: #FFB800;
    --accent-dark: #E5A600;
    --success: #2ECC71;
    --info: #17A2B8;

    /* Light Theme */
    --bg: #FFF9F5;
    --bg-secondary: #FFF0E8;
    --fg: #1A1A1A;
    --fg-secondary: #6B6B6B;
    --fg-muted: #999999;
    --card: rgba(255, 255, 255, 0.82);
    --card-hover: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 107, 53, 0.12);
    --glass: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    --overlay: rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --nav-height: 70px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #0D0D0D;
    --bg-secondary: #1A1A1A;
    --fg: #F0F0F0;
    --fg-secondary: #AAAAAA;
    --fg-muted: #666666;
    --card: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 107, 53, 0.15);
    --glass: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --overlay: rgba(0, 0, 0, 0.7);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s var(--ease), color 0.4s var(--ease);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

ul, ol { list-style: none; }

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

/* ============================================
   SPLASH SCREEN
   ============================================ */
#splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #FF6B35, #E84545, #FFB800);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
#splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-content {
    text-align: center;
    color: #fff;
}
.splash-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: splashPulse 1s ease-in-out infinite alternate;
}
.splash-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 28px;
}
.splash-loader {
    width: 180px;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}
.splash-bar {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 10px;
    animation: splashLoad 1.6s var(--ease) forwards;
}

@keyframes splashPulse {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}
@keyframes splashLoad {
    0% { width: 0%; }
    60% { width: 70%; }
    100% { width: 100%; }
}

/* ============================================
   ANIMATED BACKGROUND BLOBS
   ============================================ */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
}
[data-theme="dark"] .blob { opacity: 0.08; }

.blob-1 {
    width: 600px; height: 600px;
    background: var(--primary);
    top: -150px; right: -100px;
    animation: blobFloat1 25s ease-in-out infinite;
}
.blob-2 {
    width: 500px; height: 500px;
    background: var(--accent);
    bottom: -100px; left: -100px;
    animation: blobFloat2 30s ease-in-out infinite;
}
.blob-3 {
    width: 400px; height: 400px;
    background: var(--secondary);
    top: 50%; left: 40%;
    animation: blobFloat3 20s ease-in-out infinite;
}

@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 60px) scale(1.1); }
    66% { transform: translate(40px, -40px) scale(0.9); }
}
@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -80px) scale(1.15); }
    66% { transform: translate(-50px, 30px) scale(0.85); }
}
@keyframes blobFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, -60px) scale(1.2); }
}

/* ============================================
   GLASS UTILITY
   ============================================ */
.glass {
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
}

/* ============================================
   NAVBAR
   ============================================ */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--nav-height);
    transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
#navbar.scrolled {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    border-bottom: 1px solid var(--glass-border);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.nav-brand {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}
.nav-links a {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--fg-secondary);
    transition: color 0.3s var(--ease);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

.nav-fav-btn {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s var(--ease-bounce);
}
.nav-fav-btn:hover { transform: scale(1.05); }
.fav-count {
    background: var(--secondary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}
.fav-count:empty, .fav-count[data-count="0"] { display: none; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.icon-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.3s var(--ease), transform 0.2s var(--ease-bounce);
    font-weight: 600;
    color: var(--fg-secondary);
}
.icon-btn:hover {
    background: var(--card);
    transform: scale(1.08);
}
#lang-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mobile-only { display: none; }

/* ============================================
   HERO SECTION
   ============================================ */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 40px) 24px 60px;
    text-align: center;
}
.hero-inner {
    max-width: 720px;
    width: 100%;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 18px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--fg-secondary);
    max-width: 520px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 24px;
}
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 6px 20px;
    border-radius: 60px;
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
    border: 2px solid transparent;
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 107, 53, 0.12);
}
.search-icon {
    color: var(--fg-muted);
    font-size: 1rem;
    flex-shrink: 0;
}
#search-input {
    flex: 1;
    font-size: 1rem;
    padding: 12px 0;
    min-width: 0;
}
#search-input::placeholder { color: var(--fg-muted); }

.voice-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--fg-secondary);
    transition: all 0.3s var(--ease);
    flex-shrink: 0;
}
.voice-btn:hover { background: var(--card); color: var(--primary); }
.voice-btn.listening {
    background: var(--secondary);
    color: #fff;
    animation: voicePulse 1s ease-in-out infinite;
}
@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 69, 69, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(232, 69, 69, 0); }
}

.search-submit {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-bounce), box-shadow 0.3s var(--ease);
}
.search-submit:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    padding: 8px;
}
.suggestions-dropdown[hidden] { display: none; }
.suggestion-item {
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s var(--ease);
    font-size: 0.92rem;
}
.suggestion-item:hover, .suggestion-item.active {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
}
.suggestion-item img {
    width: 40px; height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.suggestion-item .sug-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    transform: translateX(-100%);
    transition: transform 0.4s var(--ease);
}
.btn:hover::before { transform: translateX(0); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(255, 184, 0, 0.3);
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 184, 0, 0.45);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45);
}
.btn-outline {
    border: 2px solid var(--card-border);
    color: var(--fg-secondary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
}

/* Search History */
.search-history {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.search-history[hidden] { display: none; }
.history-label {
    font-size: 0.82rem;
    color: var(--fg-muted);
    font-weight: 500;
}
.history-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--fg-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.history-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.clear-history {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--fg-muted);
    transition: color 0.2s var(--ease);
}
.clear-history:hover { color: var(--secondary); }

/* ============================================
   FILTERS SECTION
   ============================================ */
.filters-section {
    padding: 0 24px 12px;
    position: sticky;
    top: var(--nav-height);
    z-index: 50;
    background: var(--bg);
    transition: background 0.4s var(--ease);
}
.filters-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.filters-inner::-webkit-scrollbar { display: none; }

.filter-btn {
    padding: 8px 22px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--fg-secondary);
    transition: all 0.3s var(--ease);
}
.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(255, 107, 53, 0.3);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    white-space: nowrap;
}
.section-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--card-border), transparent);
    border-radius: 2px;
}

/* ============================================
   TRENDING SCROLL
   ============================================ */
.trending-scroll,
.recent-scroll {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.trending-scroll::-webkit-scrollbar,
.recent-scroll::-webkit-scrollbar { display: none; }

.trending-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    position: relative;
}
.trending-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.trending-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}
.trending-card:hover img { transform: scale(1.06); }
.trending-card .trending-img-wrap {
    overflow: hidden;
    position: relative;
}
.trending-card .trending-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--secondary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.trending-card .trending-info {
    padding: 14px 16px;
}
.trending-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trending-card .trending-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--fg-muted);
}

/* ============================================
   RECIPE GRID
   ============================================ */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

/* Recipe Card */
.recipe-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s var(--ease);
    position: relative;
    opacity: 0;
    transform: translateY(24px);
    animation: cardIn 0.5s var(--ease) forwards;
}
.recipe-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    background: var(--card-hover);
}

@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

.card-img-wrap {
    position: relative;
    overflow: hidden;
    height: 200px;
}
.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.recipe-card:hover .card-img-wrap img { transform: scale(1.08); }

.card-category-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.2);
}
.card-fav-btn {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s var(--ease);
    z-index: 2;
}
.card-fav-btn:hover { transform: scale(1.15); }
.card-fav-btn.is-fav {
    color: var(--secondary);
    background: rgba(255,255,255,0.9);
}

.card-body {
    padding: 16px 18px 18px;
}
.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-desc {
    font-size: 0.82rem;
    color: var(--fg-secondary);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--fg-muted);
}
.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
}
.card-rating i { font-size: 0.72rem; }

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--card-border);
}
.skeleton-img {
    height: 200px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-body { padding: 16px 18px 18px; }
.skeleton-line {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    margin-bottom: 10px;
}
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--fg-muted);
}
.empty-state.small { padding: 40px 20px; }
.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--fg-secondary);
    margin-bottom: 8px;
}
.empty-state p { font-size: 0.92rem; }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination[hidden] { display: none; }
.page-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--fg-secondary);
    transition: all 0.2s var(--ease);
}
.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: transparent;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--bg);
    border-radius: var(--radius);
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.4s var(--ease);
    scrollbar-width: thin;
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}
.modal-fav {
    max-width: 800px;
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 10;
    transition: all 0.2s var(--ease);
    color: var(--fg);
}
.modal-close:hover {
    background: var(--secondary);
    color: #fff;
    transform: rotate(90deg);
}

/* Modal Body Layout */
.modal-hero {
    position: relative;
    height: 340px;
    overflow: hidden;
}
.modal-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, var(--bg) 100%);
}

.modal-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 0 32px 32px;
    margin-top: -60px;
    position: relative;
    z-index: 2;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--fg-secondary);
}
.meta-chip i { font-size: 0.75rem; color: var(--primary); }

.modal-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.modal-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--fg-secondary);
    transition: all 0.2s var(--ease);
}
.modal-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.modal-action-btn.fav-active {
    border-color: var(--secondary);
    color: var(--secondary);
    background: rgba(232, 69, 69, 0.08);
}

.modal-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-section-title i { color: var(--primary); font-size: 0.95rem; }

/* Ingredients Checklist */
.ingredient-list {
    display: grid;
    gap: 6px;
}
.ingredient-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    transition: background 0.2s var(--ease);
    cursor: pointer;
}
.ingredient-item:hover { background: var(--card); }
.ingredient-check {
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s var(--ease);
    font-size: 0.65rem;
    color: transparent;
}
.ingredient-item.checked .ingredient-check {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.ingredient-item.checked .ingredient-text {
    text-decoration: line-through;
    color: var(--fg-muted);
}

/* Instructions */
.instructions-list {
    counter-reset: step;
}
.instruction-step {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    counter-increment: step;
}
.step-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 2px;
}
.step-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--fg-secondary);
}

/* Video Embed */
.video-embed {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
    aspect-ratio: 16/9;
    background: #000;
}
.video-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Nutrition Chart */
.nutrition-chart-wrap {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}
.nutrition-chart-wrap canvas {
    max-height: 220px;
}

/* Cooking Timer */
.timer-section {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}
.timer-display {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0;
    letter-spacing: 2px;
}
.timer-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}
.timer-btn {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s var(--ease);
}
.timer-btn.start { background: var(--success); color: #fff; }
.timer-btn.start:hover { opacity: 0.85; }
.timer-btn.pause { background: var(--accent); color: #1a1a1a; }
.timer-btn.pause:hover { opacity: 0.85; }
.timer-btn.reset { background: var(--card); border: 1px solid var(--card-border); }
.timer-btn.reset:hover { border-color: var(--secondary); color: var(--secondary); }

/* Fav Modal */
.fav-modal-header {
    padding: 28px 32px 0;
}
.fav-modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.fav-modal-header h2 i { color: var(--secondary); }
.fav-modal-body {
    padding: 20px 32px 32px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--fg);
    transform: translateX(120%);
    animation: toastIn 0.4s var(--ease) forwards;
    max-width: 360px;
}
.toast.removing { animation: toastOut 0.3s var(--ease) forwards; }
.toast i { font-size: 1rem; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--secondary); }
.toast.info i { color: var(--info); }

@keyframes toastIn {
    to { transform: translateX(0); }
}
@keyframes toastOut {
    to { transform: translateX(120%); opacity: 0; }
}

/* ============================================
   FOOTER
   ============================================ */
#footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    margin-top: 60px;
    transition: background 0.4s var(--ease);
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 24px 32px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}
.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}
.footer-brand p {
    font-size: 0.88rem;
    color: var(--fg-secondary);
    line-height: 1.6;
    max-width: 300px;
}
.footer-links h4,
.footer-social h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
}
.footer-links a {
    display: block;
    font-size: 0.88rem;
    color: var(--fg-secondary);
    margin-bottom: 8px;
    transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--primary); }
.social-icons {
    display: flex;
    gap: 10px;
}
.social-icons a {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--fg-secondary);
    transition: all 0.3s var(--ease);
}
.social-icons a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}
.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--fg-muted);
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .modal-content-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    :root { --nav-height: 60px; }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--card-border);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.35s var(--ease);
        z-index: 999;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .mobile-only { display: flex; }
    .hero-title { letter-spacing: -1px; }
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    .trending-card { flex: 0 0 240px; }
    .modal { max-height: 95vh; margin: 8px; }
    .modal-hero { height: 220px; }
    .modal-content-grid { padding: 0 20px 24px; gap: 20px; }
    .modal-title { font-size: 1.4rem; }
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .hero-sub { font-size: 0.95rem; }
    .recipe-grid { grid-template-columns: 1fr; }
    .search-bar { padding: 4px 4px 4px 14px; }
    #search-input { font-size: 0.9rem; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}